package Java练习.字符串练习;

import java.util.Scanner;

public class 遍历字符串 {
    public static void main(String[] args) {
        //流程:键盘录入字符串-转化位字符串位数组-遍历数组以达到遍历该字符串的效果.
        //键盘录入一个字符串
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入你要遍历的字符串:");
        String input=sc.next();
        int len=input.length();
        for (int i = 0; i < len; i++) {
            System.out.println(input.charAt(i));
        }
    }
}
